package com.buka.controller;

import com.buka.request.LockProductRequest;
import com.buka.service.ProductTaskService;
import com.buka.util.JsonData;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/stock/v1")
public class StockController {

    @Resource
    ProductTaskService productTaskService;

    @PostMapping("reduce")
    public JsonData reduce(@RequestBody LockProductRequest request){
        return productTaskService.reduce(request);

    }
}
